package router

import (
	"github.com/gin-gonic/gin"
	adminapis "tuowei.com/app/admin/apis"
	"tuowei.com/app/api/apis"
)

func init() {
	routerNoCheckRole = append(routerNoCheckRole, registerApiIndexRouter)
}

// 需认证的路由代码
func registerApiIndexRouter(v1 *gin.RouterGroup) {
	api := apis.ApiIndex{}
	lecturerapis := adminapis.SysLecturer{}
	materialapis := adminapis.SysMaterial{}
	//courseapis := adminapis.SysCourse{}
	v1auth := v1.Group("/index")
	{
		//获取文章咨询列表
		v1auth.POST("/wz/list", api.GetWzList)
		v1auth.GET("/wz/:id", api.GetWz)
		//文章阅读量累计
		v1auth.POST("/wz/add/num", api.WzAddNum)

		// 获取推荐学院列表
		v1auth.POST("/academy/list", api.GetAcademyList)
		v1auth.GET("/academy/:id", api.GetAcademy)

		//获取师资团队列表和详情--复用
		v1auth.GET("/lecturer", lecturerapis.GetPageApp)
		v1auth.GET("/lecturer/:id", lecturerapis.Get)
		//获取学习资料列表和详情--复用
		v1auth.GET("/material", materialapis.GetPage)
		v1auth.GET("/material/:id", materialapis.Get)

		//获取精品课程，只有在线课程有精品课程
		v1auth.GET("/boutique/course", api.GetBoutiqueCourse)
		//v1auth.GET("/boutique/course/:id", courseapis.Get)

		//获取学生端首页布局配置
		v1auth.GET("/config", api.Config)
		//获取轮播图
		v1auth.POST("/lbt", api.GetLbt)
		//首页搜索
		v1auth.POST("/search", api.Search)
		// 更新版本检测
		v1auth.GET("/checkVersion", api.Version)
	}
}
